package logic

import (
	"context"

	"xialou_platform/services/agent/rpc/agentClient"
	"xialou_platform/services/agent/rpc/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type FindActiveBindCountByCatdIDsLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewFindActiveBindCountByCatdIDsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FindActiveBindCountByCatdIDsLogic {
	return &FindActiveBindCountByCatdIDsLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 查询指定卡已激活绑定用户数
func (l *FindActiveBindCountByCatdIDsLogic) FindActiveBindCountByCatdIDs(in *agentClient.FindActiveBindCountByCatdIDsReq) (*agentClient.FindActiveBindCountByCatdIDsResp, error) {

	count := l.svcCtx.AgentUserModel.FindActiveBindCountByCatdIDs(l.ctx, in.Ids)
	return &agentClient.FindActiveBindCountByCatdIDsResp{
		Count: count,
	}, nil
}
